<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>导航</title>
    <style>
        * {
            margin: 0;
            padding: 0;
        }

        #container {
            width: 100%;
            height: 100vh;
            background-color: pink;
        }

    </style>

</head>

<body>
<div id="container"></div>
<script type="text/javascript">
        window._AMapSecurityConfig = {
            securityJsCode: 'b99ece896f708f94b6adcd86b8ea0bed',
        }


</script>
<script type="text/javascript"
        src="https://webapi.amap.com/maps?v=1.4.15&key=365f9643d30862c91e786b14b89b7cf3"></script>
<script>
        // 初始化地图
        var map = new AMap.Map("container", {
            zoom: 15, //缩放级别
            center: [108.721005, 23.685513], //中心点坐标
        })

        function beginDriving(start, end) {
            AMap.plugin("AMap.Driving", function () {
                var driving = new AMap.Driving({
                    // 驾车路线规划策略，AMap.DrivingPolicy.LEAST_TIME是最快捷模式
                    policy: AMap.DrivingPolicy.LEAST_TIME,
                    map,
                })
                var points = [{ keyword: start }, { keyword: end }]
                driving.search(points, function (status, result) {
                    // 未出错时，result即是对应的路线规划方案
                })
            })
        }

</script>
</body>

</html>